home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-25 | 6.5 KB | 122 lines | [TEXT/MPS ] |
-
- -----------Blat dcmd------------
-
- Bo3b Johnson
- MS 37-RR
-
- Version 3. There was no prior general release.
-
- Version 5. 11/2/91 Fixed numerous bugs, and I'm sure there are more.
- Works with Macsbug Log now, and switching video pages.
- Fixes for VM not being installed, so that error checking works properly on IIx.
- Tested on IIx and IIfx.
- Seems to be incompatible with DAL.
-
- Introduction:
- Blat is a dcmd that uses the MMU in order to catch references to memory locations
- 0 through 255. That is, it will stop any program from reading or writing to the
- memory that starts at zero, and is 256 bytes long. That hunk of memory is reserved
- for Motorola, and is used as the exception vectors for the CPU. There is no data
- down there, and cannot be, since it is used directly by the CPU. This tool is then to
- catch any runtime references to those locations and to stop in the debugger when
- they are seen. Notably this includes memory location 0 itself, which has been noted
- to be an evil location in the past. Think of Blat as a Super Gonzo Mr. Bus Error.
-
- Compatibility:
- I've run it successfully on IIfx, IIx, SE/30, IIcx.
-
- It is not compatible with IIsi, IIci, LC or any computers using that ROM.
- It is not compatible with 040 class machines.
- You have to have an MMU in order to use it.
- You cannot use VM with Blat.
- It is not compatible with TMon Pro.
- Doesn't seem to be compatible with DAL (on IIx).
-
- Installing:
- Copy the dcmd into your debugger prefs file and reboot.
-
- Notably, Blat will change the VBR register and install its own MMU tables when
- it is installed, even if it isn't turned on. This adds uncertainty to the machine,
- so it is probably best to only have it installed when you are actively using it.
- Typically when Blat screws up, the computer is wedged in a big way. In addition,
- it will slow your machine, since the tables are smaller, and bus errors are being
- handled. It is occasionally visibly slower, but probably around 10% overall.
-
- Use:
- The Blat command line is:
- Blat Off | Writes | Both | Dump | Ignore $xxx ... | IP | IL | Learn | Auto | Status
-
- 'Blat Writes' will turn on memory protection for writes to 0..255, and will stop
- whenever any code changes that memory. Blat will automatically give you an
- IP around the offending code so you can inspect it. Realize that you have stopped
- in Blat, and not in the offending code, so the registers and the stack are not correct
- for the code that is disassembled.
-
- 'Blat Off' will turn the memory protection off, so that no errors are reported. As
- an implementation detail, the MMU is still active and catching writes to that
- page, it just isn't being reported. I do this so that I can keep the VBR based copy
- of the vectors up to date.
-
- 'Blat Both' will catch reads and writes both. I think this is cool, and I hope you do
- too, since it was brought to you at great expense. Whenever any code touches that
- page, it will be busted, and displayed in a similar way. While testing it I've seen a
- lot of code that fools around down there, that has no business doing so. You will
- see this as soon as you try to use a menu with Both turned on. Any reason why
- the MDEF needs to read memory location 4?
-
- As you use Blat, you will find that it catches everything, including legitimate
- system code that installs a temporary bus error handler. Those bus errors happen,
- and are caught by the system. Writing to memory location 8 is the most likely
- candidate in the system. Nearly all are legitimate, but I don't special case them
- so they can be seen. This is obnoxious though, since you cannot make any
- progress with Blat firing every few microseconds. The rest of the features are
- to deal with this problem.
-
- 'Blat Ignore $40803322' will ignore any bus errors that originate when the PC is
- at that address. You can ignore a specific address, or a set of addresses. They are
- added to a an internal Blat table and any references are no longer reported from
- that address. There is a maximum of 50 addresses that Blat will ignore. If you
- want more, that's why I'm giving you the source code.
-
- 'Blat Dump' will give you a list of all of the addresses that Blat is ignoring. These
- are not saved over boot, so you have to build a new table each time.
-
- 'Blat Learn' helps to build a new table. If Blat is turned on, then it will
- automatically ignore the address for each error as it happens. This essentially lets
- you see the error once, then it will be ignored from that point on. Blat will tell you
- that it is learning the address, to let you know that you won't be hassled with that
- particular address from that point on.
-
- 'Blat Auto' is an even handier version of automatic learning. It will presume that
- all bus errors it sees are legitimate, and will put them in the ignore table, and not
- display them either. They are written to the Macsbug screen, so you can see them,
- but they won't stop. Once you understand how it works and examine all the
- bus errors that are displayed, this is the easiest way to fill the ignore buffer with
- the legitimate addresses. Unfortunately, some relocatable system code has bugs,
- so they will move around and cause a few false alarms. The CDEF is this way too.
-
- 'Blat IP' or 'Blat IL' will change the form of automatic disassembly that Blat shows
- for each error. Each chooses the command that Blat issues to Macsbug.
-
- 'Blat Status' will show you the state of the various flags that these options control,
- so you can see the exact setup. Learn and Auto are mutually exclusive for example,
- and neither of those actually turn Blat on.
-
- Feedback:
- Tell me what you think. Call, QuickMail, or real Mail at 37-RR. I am very curious
- to know if this is useful or not. If it helps find some bugs it serves its purpose. If
- the incompatibility problems make it useless for you, I would be interested to know
- that as well. Given the difficulty of writing code of this form, we have judged it to
- not be worth the time to make it work in every situation.
-
- I've included the source in case it is helpful. If you run into a situation that seems
- to require changing the MMU tables or the bus error handler, you should contact
- me instead of doing the work yourself. The reason is simple: the only indication
- you get when something goes wrong is the machine is hung. This makes it fairly
- hard to debug, and I already have done so. The source includes some of those
- situations as comments.
-
- Bo3b.
-
-
-